#include"visitor.h"


int main(){
    Medicine* stomach = new StomachMed();
    Medicine* cold = new ColdMed();
    Medicine* anti = new AntiInflammatoryMed();

    SfVisitor* sfVistor = new SfVisitor();
    stomach->accept(sfVistor);
    cold->accept(sfVistor);
    anti->accept(sfVistor);
    sfVistor->showTotalPrice();

    QyVisitor* qyvisitor = new QyVisitor();
    ObjectStructure obj;
    obj.addMedicine(stomach);
    obj.addMedicine(cold);
    obj.addMedicine(anti);

    obj.ProcAction(qyvisitor);

    delete sfVistor;
    delete qyvisitor;
    return 0;

}